package io.kiki.sba.registry.common.model.metaserver;


import io.kiki.sba.registry.common.model.Node.NodeType;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

@Setter
@Getter
public class ProvideDataChangeEvent implements Serializable {

    private final String dataInfoId;

    private final long version;

    private final Set<NodeType> nodeTypes;


    public ProvideDataChangeEvent(String dataInfoId, long version) {
        this(dataInfoId, version, new HashSet<>(Arrays.asList(NodeType.client_interface)));
    }

    public ProvideDataChangeEvent(String dataInfoId, long version, Set<NodeType> nodeTypes) {
        this.dataInfoId = dataInfoId;
        this.version = version;
        this.nodeTypes = Collections.unmodifiableSet(nodeTypes);
    }


}
